import type { AppRouteModule } from '/@/router/types';

import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';

const configuration: AppRouteModule = {
  path: '/baas/configuration',
  name: 'configuration',
  component: LAYOUT,
  redirect: '/baas/configuration/tenant',
  meta: {
    orderNo: 1,
    icon: 'ion:build-outline',
    title: t('routes.baas.configuration.center'),
  },
  children: [
    {
      path: 'tenant',
      name: 'tenant',
      meta: {
        title: t('routes.baas.configuration.tenant.list'),
      },
      component: () => import('/@/views/baas/configuration/tenant/index.vue'),
      children: [
        {
          path: 'tenantAdd',
          name: 'tenantAdd',
          meta: {
            title: t('routes.baas.configuration.tenant.add'),
            hideMenu: true,
          },
          component: () => import('/@/views/baas/configuration/tenant/Add.vue'),
        },
        {
          path: 'tenantDetail',
          name: 'tenantDetail',
          meta: {
            title: t('routes.baas.configuration.tenant.detail'),
            hideMenu: true,
          },
          component: () => import('/@/views/baas/configuration/tenant/Detail.vue'),
        },
      ],
    },
    {
      path: 'application',
      name: 'application',
      meta: {
        title: t('routes.baas.configuration.application.list'),
      },
      component: () => import('/@/views/baas/configuration/application/index.vue'),
    },
    {
      path: 'fileConfig',
      name: 'fileConfig',
      meta: {
        title: t('routes.baas.configuration.fileConfig.list'),
      },
      component: () => import('/@/views/baas/configuration/fileConfig/index.vue'),
    },
  ],
};

export default configuration;
